const mongoose = require("./db.js");

var DynamicSchema = mongoose.Schema({
    uid: String,//用户uid
    uname: String,//用户昵称
    d_id: String,//动态编号uid+addTime
    d_type: Boolean, //(0未发布 1已发布)
    createTime: String,
    showTime: String,
    content: String,//(正文)
    likeCount: Array,//(点赞次数)
    collectionCount: Array,//(收藏次数)
    pictureUrl: Array,//图片路径
    comment: [{//(评论)
        c_id: String,
        c_name: String,
        c_imgHead: String,
        c_addTime: String,
        c_content: String,
        c_likes: Array,
        c_type: Boolean,
    }]
});

module.exports = mongoose.model('Dynamic', DynamicSchema, 'dynamic');